package com.itheima.reggie.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 分页对象，封装页面上所有的数据
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageBean<T> {

    private List<T> records;   //这一页显示的数据
    private long total;   //一共有多少条记录
    private long size;
    private long current;
    private long pages;

    public PageBean(List<T> records, long total, long size, long current) {
        this.records = records;
        this.total = total;
        this.size = size;
        this.current = current;
    }
}
